package com.mtgdeckbuilder.client;

import java.io.IOException;
import java.util.List;

import com.google.gwt.user.client.rpc.RemoteService;
import com.google.gwt.user.client.rpc.RemoteServiceRelativePath;
import com.mtgdeckbuilder.shared.dto.DeckDTO;

/**
 * The client side stub for the RPC service.
 * 
 * @author Nicolas Deslandes
 */
@RemoteServiceRelativePath("deck")
public interface DeckService extends RemoteService {

   /**
    * Fetch the deck by its key from a source.
    * 
    * @param id the id of the deck.
    * @return the deck.
    * @throws IOException if there was an exception while fetching the deck.
    */
   DeckDTO fetch(long id) throws IOException;

   /**
    * Query a list of decks with arguments.
    * 
    * @param args the object that contains the arguments of the query.
    * @return the list of found decks.
    * @throws IOException if there was an exception while fetching the decks.
    */
   List<DeckDTO> query(DeckDTO args) throws IOException;

   /**
    * Save a deck.
    * 
    * @param deck the deck to save.
    */
   void save(DeckDTO deck);

}
